package c.c.k.controller;

import c.c.k.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chenck on 2022/3/19.
 */
@RestController
public class HomeController {
    @Autowired
    private StockService stockService;
    @Autowired
    private StockBaseService stockBaseService;
    @Autowired
    private FundBaseService fundBaseService;
    @Autowired
    private FundStockService fundStockService;
    @Autowired
    private FundService fundService;

    @GetMapping("/initStockBase")
    public Object initStockBase(){
        stockBaseService.initStockBase();
        return "ok";
    }

    @GetMapping("/updateShiZhi")
    public Object updateShiZhi(){
        stockBaseService.updateShiZhi();
        return "ok";
    }

    @GetMapping("/initStock")
    public Object initStock(){
        stockService.initStock();
        return "ok";
    }

    @GetMapping("/fetchEveryday")
    public Object fetchEveryday(){
        stockService.fetchEveryday();
        return "ok";
    }

    @GetMapping("/initMaxMin")
    public Object initMaxMin(){
        stockService.initMaxMin();
        return "ok";
    }

    @GetMapping("/initFund")
    public Object initFund(){
        fundService.initFund();
        return "ok";
    }

    @GetMapping("/initFundBase")
    public Object initFundBase(){
        fundBaseService.initFundBase();
        return "ok";
    }

    @GetMapping("/initFundStock")
    public Object initFundStock(){
        fundStockService.initFundStock();
        return "ok";
    }
}
